package com.example.wangzh.developkit.base;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.example.wangzh.developkit.constant.LogTag;
import com.example.wangzh.developkit.utils.upLoadListener;
import com.wzh.advancelog.log.WzhLog;

import leakcanary.LeakCanary;

/**
 * Created by zhwang16 on 2018/8/17.
 */

public class MyApplication extends Application {
    static MyApplication myApplication;

    public static MyApplication getInstance() {
        return myApplication;
    }

    public static Context getContext() {
        return myApplication;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(LogTag.TEST, "MyApplication>>>onCreate");
        myApplication = this;
        WzhLog.init(this);
        LeakCanary.Config config = LeakCanary.getConfig().newBuilder()
                .onHeapAnalyzedListener(new upLoadListener()).build();
        LeakCanary.setConfig(config);
    }

}
